Skip to main content

Perimeter

Easily measure a perimeter on your document or plan.

API

startCreate

Create a perimeter. You can select between Area, Annotations, Measure and Calibration.

ParamTypeDescription
toolstringSelect the desired tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[color]stringChange the color of the annotation tool
[showLength]boolToogle visibility of the length drawing of the measure - area and perimeter tool
[single]boolSelect true to make a single measure, false to make a multi-point measure
[guid]stringSet a group_guid if you want to add a pin to an existing group

Available tool options:

  • annotation: Select the annotation tool.
  • measure: Select measure tool.
  • area: Select area tool.
  • perimeter: Select perimeter tool.
  • calibration: Set a calibration to match the scale of the plan on the pdf.

Example

TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "perimeter",
showLength: "false",
},
callback: myfunc,
});
info

You can draw a multi-line or a single-line.

TFTPDFGadget.callCommand({
name: "startCreate",
args: {
tool: "perimeter",
single: "false",
},
callback: myfunc,
});

setPageAnnotation

Add a JSON annotation on the PDF. The command parse the Json with the className and draw the annotation on the correct page.

ParamTypeDescription
drawingArray.JSONArray of json annotations

Example

TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});
CAUTION
  • Call this command with an JSON object to load 1 annotation.
  • Call this command with an array of x JSON object to load all of them.
TFTPDFGadget.callCommand({
name: "setPageAnnotation",
args: { drawing: { perimeter_1 } },
callback: myfunc,
});

stopCreate

Stop the current tool.

Example

TFTPDFGadget.callCommand({
name: "stopCreate",
callback: myfunc,
});

deleteAnnotation

Delete annotation with his GUID.

ParamTypeDescription
guidstringGUID of the annotations group.

Example

TFTPDFGadget.callCommand({
name: "deleteAnnotation",
args: {
guid: "4a4f720b64b7-4170-aa1b-80c8fdb595d3",
unique_guid: "xxxxxxxxx-xxxxx-xxxxx",
},
callback: myfunc,
});

setSelection

Select a pin or a group of Annotations with their GUID.

ParamTypeDescription
guidstringGUID of the annotations group.

Example

TFTPDFGadget.callCommand({
name: "setSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});

resetSelection

Reset the current selection.

ParamTypeDescription
guidstringGUID of the annotations group.

Example

TFTPDFGadget.callCommand({
name: "resetSelection",
args: { guid: "4a4f720b-64b7-4170-aa1b-80c8fdb595d3" },
callback: myfunc,
});

moveAnnotation

Move the desired annotation - Start the state to edit position, stop with stopMoveAnnotation.

Example

TFTPDFGadget.callCommand({ name: "moveAnnotation", callback: myfunc });

stopMoveAnnotation

Disable the moveAnnotation mode.

Example

TFTPDFGadget.callCommand({
name: "stopMoveAnnotation",
callback: myfunc,
});